<!DOCTYPE html>
<html>
  <title>组件自己的data</title>
  <script src="../../js/vue.js"></script>
  <head>
    <meta charset="utf-8" />
  </head>
  <body>
    <!-- 模板分离 -->
    <template id="cpn">
      <div>
        <h1>{{title}}</h1>
        <h1>{{content}}</h1>
      </div>
    </template>

    <div id="div1">
      <cpn></cpn>
      <cpn></cpn>
    </div>
  </body>
  <script>
    const app = new Vue({
      el: "#div1",
      components: {
        cpn: {
          template: "#cpn",
          //   组件自己的data
          data() {
            return {
              title: "title",
              content: "content"
            };
          }
        }
      }
    });
  </script>
</html>
